package com.bcmusic.search.config;

/**
 * @ClassName : SwaggerConfig  //类名
 * @Description :   //描述
 * @Author : YG  //作者
 * @Date: 2020-10-18 23:41  //时间
 */
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.service.Contact;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;


@Configuration
@EnableSwagger2
public class SwaggerConfig {
    @Bean
    public Docket customDocket() {
        return new Docket(DocumentationType.SWAGGER_2)
                .apiInfo(apiInfo());
    }


    private ApiInfo apiInfo() {
        Contact contact = new Contact("梁华勇", "http://www.baidu.com/", "1634074538@qq.com");
        return new ApiInfoBuilder()
                .title("bc区块链API接口")
                .description("只有我加了文字注释的才是前端要用的接口哈")
                .contact(contact)
                .version("1.1.0")
                .build();
    }
}
